import java.io.File;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 28779
 * Date: 2023-10-25
 * Time: 14:47
 */
public class Demo2 {
    public static void main(String[] args) {
        File file = new File("./test.txt");
        File file2 = new File("./src/test2.txt");

        file.renameTo(file2);   // file 是要修改的文件，file2 是要改成什么样的文件
    }
}
